<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro" lang="zh">
<head>
    <th:block th:include="include :: header('暂存员查询')"/>
</head>
<body class="gray-bg">
<div class="container-div">
    <div class="row">
        <div class="col-sm-12 search-collapse none">
            <form id="formId">
                <div class="select-list">
                    <ul>
                        <li>
                            <p>识别码：</p>
                            <input type="text" name="codeid"/>
                        </li>
                        <li>
                            <p>采集用户sys_user表：</p>
                            <input type="text" name="collectUserId"/>
                        </li>
                        <li class="select-time">
                            <p>采集扫码时间：</p>
                            <input type="text" class="time-input" id="startTime" placeholder="开始时间"
                                   name="params[beginCollectScanDate]"/>
                            <span>-</span>
                            <input type="text" class="time-input" id="endTime" placeholder="结束时间"
                                   name="params[endCollectScanDate]"/>
                        </li>
                        <li>
                            <p>来源科室 yf_dept表：</p>
                            <input type="text" name="sourceDeptId"/>
                        </li>
                        <li class="select-time">
                            <p>扫描来源科室时间：</p>
                            <input type="text" class="time-input" id="startTime" placeholder="开始时间"
                                   name="params[beginScanDeptDate]"/>
                            <span>-</span>
                            <input type="text" class="time-input" id="endTime" placeholder="结束时间"
                                   name="params[endScanDeptDate]"/>
                        </li>
                        <li>
                            <p>医废类别：</p>
                            <select name="trashType" th:with="type=${@dict.getType('yf_trash_type')}">
                                <option value="">所有</option>
                                <option th:each="dict : ${type}" th:text="${dict.dictLabel}"
                                        th:value="${dict.dictValue}"></option>
                            </select>
                        </li>
                        <li>
                            <p>重量：</p>
                            <input type="number" name="weight"/>
                        </li>
                        <li class="select-time">
                            <p>采集时间：</p>
                            <input type="text" class="time-input" id="startTime" placeholder="开始时间"
                                   name="params[beginCollectUpdateDate]"/>
                            <span>-</span>
                            <input type="text" class="time-input" id="endTime" placeholder="结束时间"
                                   name="params[endCollectUpdateDate]"/>
                        </li>
                        <li>
                            <p>入库用户 sys_user表：</p>
                            <input type="text" name="intoUserId"/>
                        </li>
                        <li>
                            <p>暂存处 yf_dept表：</p>
                            <input type="text" name="stagingId"/>
                        </li>
                        <li>
                            <p>入库垃圾桶id yf_bucket表：</p>
                            <input type="text" name="intoBucketId"/>
                        </li>
                        <li class="select-time">
                            <p>入库时间：</p>
                            <input type="text" class="time-input" id="startTime" placeholder="开始时间"
                                   name="params[beginIntoDate]"/>
                            <span>-</span>
                            <input type="text" class="time-input" id="endTime" placeholder="结束时间"
                                   name="params[endIntoDate]"/>
                        </li>
                        <li>
                            <p>出库用户 sys_user：</p>
                            <input type="text" name="outUserId"/>
                        </li>
                        <li>
                            <p>出库垃圾桶id yf_bucket表：</p>
                            <input type="text" name="outBucketId"/>
                        </li>
                        <li class="select-time">
                            <p>出库时间：</p>
                            <input type="text" class="time-input" id="startTime" placeholder="开始时间"
                                   name="params[beginOutDate]"/>
                            <span>-</span>
                            <input type="text" class="time-input" id="endTime" placeholder="结束时间"
                                   name="params[endOutDate]"/>
                        </li>
                        <li>
                            <p>医院 sys_dept表：</p>
                            <input type="text" name="hospitalId"/>
                        </li>
                        <li class="select-time">
                            <p>创建时间：</p>
                            <input type="text" class="time-input" id="startTime" placeholder="开始时间"
                                   name="params[beginCreateTime]"/>
                            <span>-</span>
                            <input type="text" class="time-input" id="endTime" placeholder="结束时间"
                                   name="params[endCreateTime]"/>
                        </li>
                        <li class="select-time">
                            <p>更新时间：</p>
                            <input type="text" class="time-input" id="startTime" placeholder="开始时间"
                                   name="params[beginUpdateTime]"/>
                            <span>-</span>
                            <input type="text" class="time-input" id="endTime" placeholder="结束时间"
                                   name="params[endUpdateTime]"/>
                        </li>
                        <li>
                            <p>医废垃圾出入库状态 yf_trash_status：</p>
                            <select name="trashStatus" th:with="type=${@dict.getType('yf_trash_status')}">
                                <option value="">所有</option>
                                <option th:each="dict : ${type}" th:text="${dict.dictLabel}"
                                        th:value="${dict.dictValue}"></option>
                            </select>
                        </li>
                        <li>
                            <p>出库运输车辆id：</p>
                            <input type="text" name="outCarId"/>
                        </li>
                        <li>
                            <p>状态0:正常 1:异常 yf_exception_level：</p>
                            <select name="status" th:with="type=${@dict.getType('yf_exception_level')}">
                                <option value="">所有</option>
                                <option th:each="dict : ${type}" th:text="${dict.dictLabel}"
                                        th:value="${dict.dictValue}"></option>
                            </select>
                        </li>
                        <li>
                            <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i
                                    class="fa fa-search"></i>&nbsp;搜索</a>
                            <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i
                                    class="fa fa-refresh"></i>&nbsp;重置</a>
                        </li>
                    </ul>
                </div>
            </form>
        </div>

        <div class="btn-group-sm" id="toolbar" role="group">
            <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="yf:tag:export">
                <i class="fa fa-download"></i> 导出
            </a>
        </div>
        <div class="col-sm-12 select-table table-striped">
            <table id="bootstrap-table" style=" table-layout: fixed; word-break: break-all;"></table>
        </div>
    </div>
</div>
<th:block th:include="include :: footer"/>
<script th:inline="javascript">
    var editFlag = [[${@permission.hasPermi('yf:tag:edit')}]];
    var removeFlag = [[${@permission.hasPermi('yf:tag:remove')}]];//删除
    var UremoveFlag = [[${@permission.hasPermi('yf:tag:Uremove')}]];//标记删除
    var URecovery = [[${@permission.hasPermi('yf:tag:Urecovery')}]];//标记删除恢复
    var trashTypeDatas = [[${@dict.getType('yf_trash_type')}]];
    var weightInputTypeDatas = [[${@dict.getType('yf_weight_type')}]];
    var trashStatusDatas = [[${@dict.getType('yf_trash_status')}]];
    var delFlagDatas = [[${@dict.getType('del_flag')}]];
    var statusDatas = [[${@dict.getType('yf_exception_status')}]];
    var updateWayDatas = [[${@dict.getType('yf_update_way')}]];
    var prefix = ctx + "yf/tag";
    //采集员
    var healthWorker = [[${@yf.getHealthWorker('')}]];
    //医院+暂存处
    var dept = [[${@dep.getDep()}]];
    //科室
    var deptd = [[${@yf.getList()}]];

    //《待修改》细节
    //1。删除标记状态后无法修改；
    //

    $(function () {
        var options = {
            url: prefix + "/list",
            createUrl: prefix + "/add",
            updateUrl: prefix + "/edit/{id}",
            removeUrl: prefix + "/remove",
            UremoveUrl: prefix + "/Uremove",
            exportUrl: prefix + "/export",
            URecoveryUrl: prefix + "/URecovery",
            modalName: "条形码",
            rowStyle: rowStyle,//自定义行样式
            pageSize:25,
            pageList:[25,50,75,100],
            columns: [{
                checkbox: true,

            },
                {
                    field: 'codeid',
                    title: '识别码',
                    width: '160px'
                },
                {
                    field: 'hospitalId',
                    title: '医院',
                    formatter: function (value, item, index) {
                        return $.table.selectListLabel(dept, item.hospitalId, "deptId", "deptName");
                    },
                    width: '150px'
                },
                {
                    field: 'collectUserId',
                    title: '采集员',
                    formatter: function (value, item, index) {
                        return $.table.selectListLabel(healthWorker, item.collectUserId, "userId", "userName");
                    },
                    width: '70px'
                },
                {
                    field: 'sourceBucketId',
                    title: '来源垃圾桶',
                    width: '100px'
                },
                {
                    field: 'sourceDeptId',
                    title: '来源科室',
                    width: '100px',
                    formatter: function (value, item, index) {
                        return $.table.selectListLabel(deptd, item.sourceDeptId, "deptId", "deptName");
                    }
                },
                {
                    field: 'scanDeptDate',
                    title: '扫描来源科室时间',
                    width: '160px'
                },
                {
                    field: 'trashType',
                    title: '医废类别',
                    width: '70px',
                    formatter: function (value, row, index) {
                        return $.table.selectDictLabel(trashTypeDatas, value);
                    }
                },
                {
                    field: 'weight',
                    width: '70px',
                    title: '重量(kg)'
                },

                {
                    field: 'collectUpdateDate',
                    width: '160px',
                    title: '采集更新时间'
                },
                {
                    field: 'intoUserId',
                    width: '70px',
                    title: '入库用户',
                    formatter: function (value, item, index) {
                        return $.table.selectListLabel(healthWorker, item.intoUserId, "userId", "userName");
                    }
                },
                {
                    field: 'stagingId',
                    width: '120px',
                    title: '暂存处',
                    formatter: function (value, item, index) {
                        return $.table.selectListLabel(dept, item.stagingId, "deptId", "deptName");
                    }
                },
                {
                    field: 'intoBucketId',
                    width: '100px',
                    title: '入库垃圾桶'
                },
                {
                    field: 'intoDate',
                    width: '160px',
                    title: '入库时间'
                },
                {
                    field: 'outUserId',
                    width: '70px',
                    title: '出库用户',
                    formatter: function (value, item, index) {
                        return $.table.selectListLabel(healthWorker, item.outUserId, "userId", "userName");
                    }
                },
                {
                    field: 'outBucketId',
                    width: '100px',
                    title: '出库垃圾桶'
                },
                {
                    field: 'outDate',
                    width: '160px',
                    title: '出库时间'
                },
                {
                    field: 'createTime',
                    width: '160px',
                    title: '创建时间'
                },
                {
                    field: 'updateTime',
                    width: '160px',
                    title: '更新时间'
                },
                {
                    field: 'trashStatus', width: '100px',
                    title: '医废状态',

                    formatter: function (value, row, index) {
                        return $.table.selectDictLabel(trashStatusDatas, value);
                    }
                },
                {
                    field: 'img',
                    width: '70px',
                    title: '照片'
                },
                {
                    title: '操作',
                    align: 'center',
                    width: '250px',
                    formatter: function (value, row, index) {
                        var actions = [];
                        actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.codeid + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                        return actions.join('');
                    }
                }]
        };
        $.table.init(options);
    });

    //修改行标记删除的颜色
    function rowStyle(row, index) {
        if (row.delFlag == 2) {
            return {
                classes: 'delflag'
            }
        }
        return {};
    }
</script>
</body>
</html>